#ifndef _THREAD_POOL_H
#define _THREAD_POOL_H

#include "head.h"
#include "taskqueue.h"
#include "epoll.h"

typedef struct 
{
    pthread_t * threads;
    int size;
    taskqueue_t * queue;
}threadpool_t;

//线程池操作函数
void tp_init(threadpool_t * threadpool,int threadpoolsize);
void tp_destroy(threadpool_t * threadpool);
void tp_start(threadpool_t * threadpool);
//线程执行函数
void * threadfunc(void * arg);
//子线程处理任务
void thread_task(task_t * task);

#endif